import MarkdownIt from 'markdown-it'
import { ref } from 'vue'

export function useMarkdownRender() {
  const html = ref('')
  const md = new MarkdownIt({
    html: true,
    linkify: true,
    typographer: true
  })
  function renderMarkdown(markdownText) {
    html.value = md.render(markdownText || '')
  }
  return { html, renderMarkdown }
}
